Expansion Method and Residue Theorem problems